<style type="text/css">
    .tablelist td{line-height:26px;}
    .tablelist tbody tr.odd {background:#E3F0FA}
</style>
<form class="form-inline" method="get">

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="id" value="{$id}"
                   placeholder="矿机编号">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="realname" value="{$realname}"
                   placeholder="用户名或真实姓名">
        </div>
    </div>

	 <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select class="form-control" name="state" id="state">
                <option value="a">矿机状态</option>
                <option value="1" {if isset($state) && $state eq 1}selected{/if}>正常矿机</option>
                <option value="2" {if isset($state) && $state eq 2}selected{/if}>过期矿机</option>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                确认搜索
            </button>
        </div>
    </div>
	<p class="label label-danger">该列表是用户购买的矿机。</p>
</form>
<hr>
<table class="table table-striped">
    <thead>
        <tr>
            <td>矿机编号</td>
            <td style='color:#d9534f'>用户信息</td>
            <td>矿机照片</td>
    		<td>矿机名称</td>

            <td>购买价格</td>
            <td>收益信息</td>
            <td>收益情况</td>
            <td>发放时间</td>
        </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr {if condition="$item['daynum'] eq $item['usedaynum']"} style='color:#d9534f'  {/if}>
        <td>{$item.id}</td>
        <td>
            <p>用户名:{$item.uid|get_uname}</p>
            <p>真实名:{$item.uid|get_realname}</p>
        </td>
		<td>
            <a href="{$item.img_url}" target="_blank">
                <img src="{$item.img_url}" title="{$item.title}" style='width:40px;'>
            </a>
        </td>
        <td>
            <p>{$item.title}</p>
            <p>
                <a style='color:#d9534f' href="{:url('Bot/shopbot')}?shopid={$item.id}">查看收益</a>
            <p>
        </td>

        <td>{$item.price}</td>
        <td>
            <p>共收益:{$item.daynum} 天</p>
            <p>每天:{$item.dayearn} SCB</p>
            <p>可得:<?php echo ($item['daynum']*$item['dayearn']); ?> SCB</p>
        </td>
        <td>
            <p>已收益:{$item.usedaynum} 天</p>
            <p>已收益:{$item.useearn} SCB</p>
        </td>
        <td>
            {$item.buytime|date='Y-m-d H:i:s',###}
        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$page}
    </div>
</div>
<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');
</script>
